//
//  ServerConfig.swift
//  ServerPackageDescription
//
//  Created by ping Cheng on 2017/10/26.
//

import Foundation
import PerfectHTTP

// 全局路由——请求／响应句柄
let globalRoutes:Routes = {
    var routes = Routes()
    routes.add(method: .get, uri: "/", handler: {
        request, response in
        response.appendBody(string: "welcome to perfect service")
        
        
        
        response.completed()
    })
    return routes
}()

let globalResponseFilters:[(HTTPResponseFilter, HTTPFilterPriority)] = {
     return [(Filter404(),HTTPFilterPriority.high)]
}()
